package com.ny.service.impl;

import com.ny.dao.StudentDao;
import com.ny.dao.impl.StudentDaoImpl;
import com.ny.entity.Student;
import com.ny.service.StudentService;
import java.sql.SQLException;
import java.util.List;

public class StudentServiceImpl implements StudentService {
    private StudentDao studentDao = new StudentDaoImpl();

    @Override
    public Student selectStudent(String sname, String spassword) throws SQLException {
        return studentDao.selectStudent(sname, spassword);
    }

    @Override
    public int insertStudent(Student student) throws SQLException {
        return studentDao.insertStudent(student);
    }
    @Override
    public List<Student> selectAllStudents() throws SQLException {
        return studentDao.selectAllStudents();
    }

    @Override
    public Student getStudentById(int studentId) throws SQLException {
        return studentDao.getStudentById(studentId);
    }

    @Override
    public int updateStudent(Student student) throws SQLException {
        return studentDao.updateStudent(student);
    }

    @Override
    public int deleteStudent(int studentId) throws SQLException {
        return studentDao.deleteStudent(studentId);
    }
}
